# 导入Pin模块
from machine import Pin
from machine import PWM
import time

# 定义LED1控制对象
led1 = PWM(Pin(15), freq=1000, duty=0)


# 程序入口
if __name__ == "__main__":
    duty_value = 0
    while True:
        duty_value += 10
        if duty_value > 1010:
            duty_value = 0
        led1.duty(duty_value)
        print("duty_value = {}".format(duty_value))
        time.sleep_ms(10)
